<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
  <div class="tab-content tab-addtabs">
    <div id="content">
      <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
          <section class="content-header hide">
            <h1>
              控制台 <small>Control panel</small>
            </h1>
          </section>
          <div class="content">
            <form id="add-form" class="form-horizontal nice-validator n-default n-bootstrap" role="form" data-toggle="validator" method="POST" action novalidate="novalidate">
              <div class="form-group">
                <label for="c-add_time" class="control-label col-xs-12 col-sm-2">发布时间:</label>
                <div class="col-xs-12 col-sm-8">
                  <input id="c-add_time" type="datetime" class="form-control datetimepicker" name="row[add_time]" data-date-format="YYYY-MM-DD HH:mm" value="<?=$row['add_time']?>" placeholder="默认为当天">
                </div>
              </div>
              <div class="form-group">
                <label for="c-sort" class="control-label col-xs-12 col-sm-2">排序:</label>
                <div class="col-xs-12 col-sm-8">
                  <input id="c-sort" class="form-control" name="row[sort]" type="number" value="<?=$row['sort']?>" placeholder="可为空">
                </div>
              </div>
              <div class="form-group">
                <label for="cate_id" class="control-label col-xs-12 col-sm-2">栏目:</label>
                <div class="col-xs-12 col-sm-8">
                  <select class="form-control" required="true" name="row[cate_id]">
                    <!-- <option value="0" selected="selected">请选择</option> -->
                    <?php foreach($cate as $v):?>
                    <option value="<?=$v['id']?>" <?php if($v['id'] == $row['cate_id']):?>selected<?php endif;?>>
                    <?=$v['title']?>
                    </option>
                    <?php foreach($v['children'] as $c):?>
                    <?php if(!empty($c['title']) && !empty($c['tpl_list'])):?>
                    <option value="<?=$c['id']?>" <?php if($c['id'] == $row['cate_id']):?>selected<?php endif;?>>
                    &nbsp;&nbsp;|--
                    <?=$c['title']?>
                    </option>
                    <?php endif;?>
                    <?php foreach($c['children'] as $a):?>
                    <?php if(!empty($a['title'])):?>
                    <option value="<?=$a['id']?>" <?php if($a['id'] == $row['cate_id']):?>selected<?php endif;?>>
                    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;|--
                    <?=$a['title']?>
                    </option>
                    <?php endif;?>
                    <?php endforeach;?>
                    <?php endforeach;?>
                    <?php endforeach;?>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="c-title" class="control-label col-xs-12 col-sm-2">标题:</label>
                <div class="col-xs-12 col-sm-8">
                  <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="<?=$row['title']?>">
                </div>
              </div>
              <!-- <div class="form-group">
                  <label for="c-sub_title" class="control-label col-xs-12 col-sm-2">副标题:</label>
                  <div class="col-xs-12 col-sm-8">
                      <input id="c-sub_title" class="form-control" name="row[sub_title]" type="text" value="<?=$row['sub_title']?>">
                  </div>
              </div> -->
              <div class="form-group">
                <label for="c-from" class="control-label col-xs-12 col-sm-2">来源:</label>
                <div class="col-xs-12 col-sm-8">
                  <input id="c-from" class="form-control" name="row[from]" type="text" value="<?=$row['from']?>">
                </div>
              </div>
              <!-- <div class="form-group">
                  <label for="c-from_url" class="control-label col-xs-12 col-sm-2">来源URL:</label>
                  <div class="col-xs-12 col-sm-8">
                      <input id="c-from_url" class="form-control" name="row[from_url]" type="text" value="<?=$row['from_url']?>">
                  </div>
              </div>
              <div class="form-group">
                  <label for="c-author" class="control-label col-xs-12 col-sm-2">作者:</label>
                  <div class="col-xs-12 col-sm-8">
                      <input id="c-author" class="form-control" name="row[author]" type="text" value="<?=$row['author']?>">
                  </div>
              </div>
              <div class="form-group">
                  <label for="c-editor" class="control-label col-xs-12 col-sm-2">网站编辑:</label>
                  <div class="col-xs-12 col-sm-8">
                      <input id="c-editor" class="form-control" name="row[editor]" type="text" value="<?=$row['editor']?>">
                  </div>
              </div> -->

              <div class="form-group">
                <label for="c-image" class="control-label col-xs-12 col-sm-2">封面图:</label>
                <div class="col-xs-12 col-sm-8">
                  <div class="form-inline">
                    <input id="c-image" class="form-control" size="50" name="row[img_cover]" type="text" value="<?=$row['img_cover']?>">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/*" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> 上传</button></span>
                    <ul class="row list-inline plupload-preview" id="p-image"></ul>
                  </div>
                </div>
              </div>

              <div class="form-group">
                <label for="c-tags" class="control-label col-xs-12 col-sm-2">标签:</label>
                <div class="col-xs-12 col-sm-8">
                  <input id="c-tags" class="form-control" name="row[tags]" type="text" value="<?=$row['tags']?>" placeholder="多个用英文逗号隔开">
                </div>
              </div>

              <div class="form-group">
                <label for="c-summary" class="control-label col-xs-12 col-sm-2">简介:</label>
                <div class="col-xs-12 col-sm-8">
                  <textarea name="row[summary]" class="form-control" cols="30" rows="5"><?=$row['summary']?></textarea>
                </div>
              </div>

              <!-- <div class="form-group">
                  <label for="c-content" class="control-label col-xs-12 col-sm-2">正文内容:</label>
                  <div class="col-xs-12 col-sm-8">
                      <div id="c-content" class="my-content" name="row[content]" data-uploadurl="" data-mimetype="image/*">
                          <?=$row['content']?>
                      </div>
                  </div>
              </div> -->
              <div class="form-group">
                <label for="c-content" class="control-label col-xs-12 col-sm-2">正文内容:</label>
                <div class="col-xs-12 col-sm-8">
                  <textarea id="c-content" class="form-control summernote" rows="5" name="row[content]" cols="50"><?=$row['content']?></textarea>
                </div>
              </div>


              <div class="form-group">
                <label for="c-is_rec" class="control-label col-xs-12 col-sm-2">推荐:</label>
                <div class="col-xs-12 col-sm-8">
                  <label for="row[is_rec]-0"><input id="row[is_rec]-0" name="row[is_rec]" type="radio" value="0" <?php if(!isset($row['is_rec']) || $row['is_rec'] == 0):?>checked<?php endif;?> /> 无</label>&nbsp;&nbsp;&nbsp;
                  <!-- <label for="row[is_rec]-2"><input id="row[is_rec]-2" name="row[is_rec]" type="radio" value="2" <?php if(isset($row['is_rec']) && $row['is_rec'] == 2):?>checked<?php endif;?> /> 头条</label>&nbsp;&nbsp;&nbsp; -->
                  <label for="row[is_rec]-1"><input id="row[is_rec]-1" name="row[is_rec]" type="radio" value="1" <?php if(isset($row['is_rec']) && $row['is_rec'] == 1):?>checked<?php endif;?> /> 推荐</label>&nbsp;&nbsp;&nbsp;
                  <!-- <label for="row[is_rec]-3"><input id="row[is_rec]-3" name="row[is_rec]" type="radio" value="3" <?php if(isset($row['is_rec']) && $row['is_rec'] == 3):?>checked<?php endif;?> /> 置顶</label> -->
                </div>
              </div>

              <div class="form-group">
                <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
                <div class="col-xs-12 col-sm-8">

                  <label for="row[status]-normal"><input id="row[status]-normal" name="row[status]" type="radio" value="1" <?php if(!isset($row['status']) || $row['status'] == 1):?>checked<?php endif;?> /> 正常</label>&nbsp;&nbsp;&nbsp;
                  <label for="row[status]-hidden"><input id="row[status]-hidden" name="row[status]" type="radio" value="0" <?php if(isset($row['status']) && $row['status'] == 0):?>checked<?php endif;?> /> 隐藏</label>

                </div>
              </div>

              <div class="form-group layer-footer">
                <label class="control-label col-xs-12 col-sm-2"></label>
                <div class="col-xs-12 col-sm-8">
                  <button type="submit" class="btn btn-success btn-embossed disabled">确定</button>
                  <button type="reset" class="btn btn-default btn-embossed">重置</button>
                  <button type="button" class="btn btn-primary btn-embossed preview">预览</button>
                </div>
              </div>
            </form>
          </div>

          <div id="preview-body">

          </div>

        </div>
      </div>
    </div>
  </div>
</div>
</body>